﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Apollo
{
    [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
    public class ApolloAttribute : Attribute
    {
        public ApolloAttribute(Type t)
        {
            try
            {
                IModule module = Activator.CreateInstance(t) as IModule;
                this.Module = module;
            }
            catch (Exception ex) {
                if (t != null)
                    Application.LogError("Failed to load module of type " + t.Name, ex);
                else
                    Application.LogError("Type is null");
            }
        }

        public IModule Module { get; private set; }
    }
}
